﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Nova.Parsing.GoldParser.Semantic;

namespace Nova.Parsing.Tokens
{
    [Terminal("return")]
    [Terminal("break")]
    [Terminal("continue")]
    [Terminal("case")]
    [Terminal("default")]
    public class KeywordToken : NovaToken
    {
        private NovaKeyword m_Keyword;
 
        public KeywordToken(string keyword)
        {
            switch (keyword)
            {
                case "return": m_Keyword = NovaKeyword.Return; break;
                case "break": m_Keyword = NovaKeyword.Break; break;
                case "continue": m_Keyword = NovaKeyword.Continue; break;
                case "case": m_Keyword = NovaKeyword.Case; break;
                case "default": m_Keyword = NovaKeyword.Default; break;
                case "": m_Keyword = NovaKeyword.Empty; break;
                default: m_Keyword = NovaKeyword.Unknown; break;
            }
        }

        public NovaKeyword Keyword
        {
            get { return m_Keyword; }
        }
    }
}
